/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model.Entity.SIS;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author user12
 */
@Embeddable
public class CourseDegreePK implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Basic(optional = false)
    @NotNull
    @Column(name = "COURSE_NO")
    private short courseNo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DEGREE_CODE")
    private short degreeCode;

    public CourseDegreePK() {
    }

    public CourseDegreePK(short courseNo, short degreeCode) {
        this.courseNo = courseNo;
        this.degreeCode = degreeCode;
    }

    public short getCourseNo() {
        return courseNo;
    }

    public void setCourseNo(short courseNo) {
        this.courseNo = courseNo;
    }

    public short getDegreeCode() {
        return degreeCode;
    }

    public void setDegreeCode(short degreeCode) {
        this.degreeCode = degreeCode;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) courseNo;
        hash += (int) degreeCode;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CourseDegreePK)) {
            return false;
        }
        CourseDegreePK other = (CourseDegreePK) object;
        if (this.courseNo != other.courseNo) {
            return false;
        }
        if (this.degreeCode != other.degreeCode) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.SisCourseDegreesPK[ courseNo=" + courseNo + ", degreeCode=" + degreeCode + " ]";
    }
    
}
